package com.yiyao.controller;

import com.yiyaowang.health.request.SubjectRequest;
import com.yiyaowang.health.service.SubjectService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/hello")
public class HController {
    @Reference
    private SubjectService subjectService;


    @RequestMapping("/kemu/addIndex")
    public String kemuadd(){
        return "kemuadd";
    }

    @RequestMapping(value = "/kemu/add",method = RequestMethod.POST)
    @ResponseBody
    public String sDoctor(String name){
        SubjectRequest request=new SubjectRequest();
        request.setName(name);
        subjectService.add(request);
        return "添加成功";
    }
}
